home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 18
/
CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso
/
CUCD
/
Magazine
/
C_Tutorial
/
Part-1
/
basics2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-06-05
|
1KB
|
47 lines
#include<exec/libraries.h>
#include<intuition/intuition.h>
#include<utility/tagitem.h>
#include<graphics/text.h>
#include<string.h>
#include<clib/exec_protos.h>
#include<clib/graphics_protos.h>
#include<clib/intuition_protos.h>
struct Library* GfxBase;
struct Library* IntuitionBase;
void main()
{
GfxBase = OpenLibrary("graphics.library",36);
if(GfxBase != NULL)
{
IntuitionBase = OpenLibrary("intuition.library",36);
if(IntuitionBase != NULL)
{
struct Window* win;
win = OpenWindowTags(NULL,
WA_Left, 20,
WA_Top, 20,
WA_Width, 200,
WA_Height, 100,
WA_Flags, WFLG_CLOSEGADGET,
WA_IDCMP, IDCMP_CLOSEWINDOW,
TAG_DONE, 0);
if(win != NULL)
{
char* text;
text = "Hello World!";
SetAPen(win->RPort, 1);
Move(win->RPort, 10, 60);
Text(win->RPort, text, strlen(text));
WaitPort(win->UserPort);
CloseWindow(win);
}
CloseLibrary(IntuitionBase);
}
CloseLibrary(GfxBase);
}
}